package com.port.eleport.model.plat;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.port.eleport.model.base.IdEntity;

/**
 * 商家类型等级表
 * @author jameschen
 *
 */
@Entity
@Table(name = "plat_merchant_type", schema = "")
@DynamicInsert(true)
@DynamicUpdate(true)
public class TMerchantType extends IdEntity  {
	
	/**
	 * 类型名称
	 */
	@Column(name = "name_")
	private String name;
	
	/**
	 * 类型描述
	 */
	@Column(name = "desc_")
	private String desc;
	
	/**
	 * 顺序
	 */
	@Column(name = "index_")
	private Integer index;
	
	/**
	 * 库存限制
	 */
	@Column(name = "inventory_limited")
	private Integer inventoryLimited;

	/**
	 * 属于该类型的商家
	 */
	@OneToMany(mappedBy="type",fetch = FetchType.LAZY)
	private Set<TMerchant> merchants=new HashSet<TMerchant>();
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public Integer getIndex() {
		return index;
	}

	public void setIndex(Integer index) {
		this.index = index;
	}

	public Integer getInventoryLimited() {
		return inventoryLimited;
	}

	public void setInventoryLimited(Integer inventoryLimited) {
		this.inventoryLimited = inventoryLimited;
	}

	public Set<TMerchant> getMerchants() {
		return merchants;
	}

	public void setMerchants(Set<TMerchant> merchants) {
		this.merchants = merchants;
	}
}
